# Contributor: Hoang Nguyen <folliekazetani@protonmail.com>
# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=popeye
pkgver=0.10.1
pkgrel=0
pkgdesc="Kubernetes cluster resource sanitizer"
url="https://popeyecli.io/"
arch="all"
license="Apache-2.0"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/derailed/popeye/archive/refs/tags/v$pkgver.tar.gz"

build() {
	GOLDFLAGS="
	-X github.com/derailed/popeye/cmd.version=v$pkgver
	-X github.com/derailed/popeye/cmd.commit=AlpineLinux
	-X github.com/derailed/popeye/cmd.date=$(date +%FT%T%Z)
	"
	go build -v -tags netgo -o bin/$pkgname -ldflags "$GOLDFLAGS"
}

check() {
	go test ./...
}

package() {
	install -Dm755 bin/$pkgname "$pkgdir"/usr/bin/$pkgname
}

sha512sums="
e0beaae8b6852b3925bbaea473b277c701be443267033e20b5ecbaa21066358d4dc4b0bb8078946c9ed778c472a7f625c77a5f328da51ce3300eb45da417c118  popeye-0.10.1.tar.gz
"
